package com.hiedu.beans.dto;

import lombok.Data;
import lombok.Value;

import javax.validation.constraints.Digits;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @ProjectName: hi-app
 * @Titile: ProductAddDTO
 * @Author: 86150
 * @Description: TODO
 */
@Data
public class ProductAddDTO {
    @NotBlank(message = "商品名称不能为空")
    private String name;
    @NotNull(message = "商品价格不能为空")
    // todo 不能低于0.0
    //@Digits(message = "商品价格必须是数字,精度是小数点后两位，整数部分不能超过5位",integer = 5,fraction = 2)
    private Float price;
    @NotNull(message = "商品数量不能为空")
    @Min(value = 1,message = "商品的数量不能小于1")
    private Integer num;
}
